package com.example;

import org.springframework.ai.ollama.OllamaChatModel;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
public class OllamaChatService {

    OllamaChatModel ollamaChatModel;

    @Autowired
    public void setChatModel(OllamaChatModel ollamaChatModel) {
        this.ollamaChatModel = ollamaChatModel;
    }

    public String chat(String userText) {
        return ollamaChatModel.call(userText);
    }
}
